<?php
/*
 **************************************************************************************************
 *	The template for displaying category pages
 **************************************************************************************************
*/
?>

<?php get_header(); ?><!-- load header.php -->

<section id="content">
	<div class="container">
		<div class="row">
			<!-- main content area -->
			<div class="span8">
			<!-- checks if the current wordpress query has any results to loop over -->
			<?php if ( have_posts() ) : ?>
				<h1 class="archive-title"><?php printf( __( 'Category Archives: %s', TEXTDOMAIN ), single_cat_title( '', false ) ); ?></h1>
				<!-- show an optional category description -->
				<?php if ( category_description() ) : ?>
					<div class="archive-meta"><?php echo category_description(); ?></div>
				<?php endif; ?>
				<div class="blankline30"></div>
			<?php
					while ( have_posts() ) :
						// iterate the post index in the loop
						the_post();
						// load a template part ( load content-{post_format}.php )
						get_template_part( 'content', get_post_format() );
					endwhile;

					// paging navigation
					if ( function_exists( 'wp_pagenavi' ) ) :
						wp_pagenavi(); // pagenavi plugin
					else :
						prototype_paging_nav();
					endif;
				else :
					// load content-none.php
					get_template_part( 'content', 'none' );
				endif;
			?>
			</div>
			<!-- sidebar area -->
			<div class="span4">
				<aside class="right-sidebar">
					<?php get_sidebar(); ?><!-- load sidebar.php -->
				</aside>
			</div>
		</div>
	</div>
</section>

<?php get_footer(); ?><!-- load footer.php -->